<template>
  <view class="parking-container">
    <view class="main-container">
      <view class="user-container">
        <view class="avatar-container">
          <img :src="user.avatarUrl" alt="">
        </view>
        <view class="name-container">{{user.name}}</view>
      </view>
<!--      <view class="action-container">-->

<!--      </view>-->
    <view class="item-container" style="margin-top: 10px">
      <view class="title-container">
        <view class="title">账号</view>
      </view>
      <view class="action-container">
        <view>{{ user.mobileNumber }}</view>
      </view>
    </view>
    </view>
  </view>
</template>
<script lang="ts">
import { token, user } from '@/util/storage'
import Vue from 'vue'
export default Vue.extend({
  computed: {
    user: () => JSON.parse(user.get()),
    redirect() {
      return encodeURI("/pages/parking/mine");
    }
  },
  mounted() {
    if (!token.get()) {
      location.href = "/#/pages/login/wechat?redirect=" + this.redirect;
      return;
    }
  },
})
</script>
<style>
.parking-container {
  width: 100vw;
  height: 100vh;
  display: flex;
  flex-direction: column;
}

.header-container {
  color: #fff;
  height: 24px;
  padding: 15px;
  flex-shrink: 0;
  display: flex;
  background: #006b65;
}

.header-container .left,
.header-container .right {
  font-size: 16px;
  width: 100px;
  flex-shrink: 0;
  display: flex;
  justify-content: center;
  align-items: center;
}

.header-container .center {
  flex-grow: 1;
  display: flex;
  justify-content: center;
  align-items: center;
}

.main-container {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  overflow: auto;
  background-color: #f0f0f0;
}

.user-container {
  padding: 15px;
  background-color: #fff;
  display: flex;
  flex-direction: column;
}

.user-container .avatar-container,.user-container .name-container,.user-container .push-btn-container {
  display: flex;
  justify-content: center;
  align-items: center;
}

.user-container .avatar-container img {
  width: 30vw;
  height: 30vw;
  border-radius: 15vw;
}

.user-container .push-btn-container {
  margin-top: 15px;
}

.user-container .push-btn-container .push-btn {
  color: #ffffff;
  font-size: 14px;
  background-color: #006b65;
  border-color: #006b65;
}

.action-container {
  background-color: #fff;
  /*margin-top: 15px;*/
  display: flex;
}

.action-container .action {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  padding: 5px;
}

.action-container .action .icon-container,.action-container .action .name-container {
  width: 100%;
  text-align: center;
}

.action-container .action .icon-container img {
  width: 10vw;
  height: 10vw;
}

.action-container .action .name-container {
  font-size: 14px;
}
.item-container {
  display: flex;
  margin-bottom: 15px;
  padding: 15px;
  background-color: #fff;
  border-radius: 12px;
}

.item-container .title-container {
  flex-grow: 1;
  font-size: 16px;
}

.item-container .action-container {
  font-size: 16px;
  width: 70px;
  display: flex;
  flex-shrink: 0;
  justify-content: center;
}

.item-container .action-container .edit-btn {
  color: #007aff;
  margin-right: 20px;
}
</style>
